<div class="form-container">
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<div class="walk-register-buttons" style="float: left;">
<a href="<?php echo( base_url() ); ?>cmb/member/home/<?php echo( $urlKey ); ?>/" target="_self">Member Home</a>
->&nbsp<a href="<?php echo( base_url() ); ?>cmb/member_reports/gen_reports/<?php echo( $urlKey ); ?>/" target="_self">Reports Home</a>
->&nbsp<a href="<?php echo( base_url() ); ?>cmb/member_reports/gen_reports_mahasamadhi_home/<?php echo( $urlKey ); ?>/" target="_self">Mahasamadhi Reports Home</a>
->&nbsp<a href="<?php echo( base_url() ); ?>cmb/member_reports/mahasamadhi_registrants_report_process/<?php echo( $urlKey ); ?>/" target="_self">Registrants Search</a>
</div>
<div class="walk-register-buttons" style="float: right;">
	<a href="<?php echo( base_url() ); ?>cmb/member/homepage_logout/"><img src="<?php echo( base_url() ); ?>assets/images/buttons/logout1.gif" border="0" /></a>
</div>

<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
			
	Spacer::Render(0, 40);

	echo '<a href="'.base_url().'cmb/member_reports/download_mahasamadhi_registrants_report/'.$urlKey.'/" target="_self">Download Data</a>';

	Spacer::Render(0, 20);
	
	$curdatetime = time();
	
	$curdate = date('l, F jS, Y', $curdatetime);
	Form::OpenFormItemSummary('Date:', 50);
		echo( form_label($curdate, 'numrecs', 'style="width: 50px;" ') );
	Form::CloseFormItem();

	$curtime = date('h:i:s A', $curdatetime);
	Form::OpenFormItemSummary('Time:', 50);
		echo( form_label($curtime, 'numrecs', 'style="width: 50px;" ') );
	Form::CloseFormItem();

	Form::OpenFormItemSummary('Year:', 260);
		echo( form_label($year, 'year', 'style="width: 20px;" ') );
	Form::CloseFormItem();
	
	Form::OpenFormItemSummary('Number of search results:', 260);
		echo( form_label(count($mrhinfoarr), 'srchres', 'style="width: 20px;" ') );
	Form::CloseFormItem();
	echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');

	if (count($mrhinfoarr) > 0)
	{
		Spacer::Render(0, 20);
		echo ( form_label('<b><font size="2" color="black">Search Criteria</b></font>','biksha',array('class'=>'biksha','style'=>'clear: left; float: left; text-align: left; margin: 0 10px 0 0; width: 600px;')) );
		Spacer::Render(0, 20);
		echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 100px;">First Name:</div><div class="form-item-value" style="width: 250px;">');
			if (!empty($searchcriteria['registrantfirstname']))
				echo ( form_label('<font size="2" color="black">'.$searchcriteria['registrantfirstname'].'%</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
			else
				echo ( form_label('<font size="2" color="black">All</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
		
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 100px;">Last Name:</div><div class="form-item-value" style="width: 250px;">');
			if (!empty($searchcriteria['registrantlastname']))
				echo ( form_label('<font size="2" color="black">'.$searchcriteria['registrantlastname'].'%</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
			else
				echo ( form_label('<font size="2" color="black">All</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 100px;">City:</div><div class="form-item-value" style="width: 250px;">');
			if (!empty($searchcriteria['registrantcity']))
				echo ( form_label('<font size="2" color="black">'.$searchcriteria['registrantcity'].'%</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
			else
				echo ( form_label('<font size="2" color="black">All</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 100px;">State:</div><div class="form-item-value" style="width: 250px;">');
			if ((!empty($searchcriteria['registrantstate'])) and ($searchcriteria['registrantstate'] != "All"))
				echo ( form_label('<font size="2" color="black">'.$searchcriteria['registrantstate'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
			else
				echo ( form_label('<font size="2" color="black">All</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 100px;">Country:</div><div class="form-item-value" style="width: 250px;">');
			if ((!empty($searchcriteria['registrantcountry'])) and ($searchcriteria['registrantcountry'] != "All"))
				echo ( form_label('<font size="2" color="black">'.$searchcriteria['registrantcountry'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
			else
				echo ( form_label('<font size="2" color="black">All</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
		Spacer::Render(0, 10);
		
		Spacer::Render(0, 20);
		echo ( form_label('<b><font size="2" color="black">Totals</b></font>','biksha',array('class'=>'biksha','style'=>'clear: left; float: left; text-align: left; margin: 0 10px 0 0; width: 600px;')) );
		Spacer::Render(0, 20);
		echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 150px;">Total # Adults:</div><div class="form-item-value" style="width: 250px;">');
			echo ( form_label('<font size="2" color="black">'.$totarr['adulttotal'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 150px;">Total # Children:</div><div class="form-item-value" style="width: 250px;">');
			echo ( form_label('<font size="2" color="black">'.$totarr['childtotal'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 150px;">Total # CHYK\'s:</div><div class="form-item-value" style="width: 250px;">');
			echo ( form_label('<font size="2" color="black">'.$totarr['chyktotal'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 150px;">Total Committed:</div><div class="form-item-value" style="width: 250px;">');
			echo ( form_label('<font size="2" color="black">$'.$totarr['totcommitted'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<div class="form-item"><div class="form-item-key" style="margin: 0 10px 0 0; width: 150px;">Total Paid:</div><div class="form-item-value" style="width: 250px;">');
			echo ( form_label('<font size="2" color="black">$'.$totarr['totpaid'].'</font>','',array('class'=>'fn','style'=>'width: 250px;')) );
		echo('</div><div class="clear"></div></div>');
	
		echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
		Spacer::Render(0, 20);
		
		echo('<table border="1" bgcolor = "#D3D3D3" cellpadding="5" width="100%">');

		$i = 0;
		echo('<tr>');
		echo('<th><center>&nbsp<b>Reg&nbspCode</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>First&nbspName</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Last&nbspName</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Referrer&nbspFirst&nbspName</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Referrer&nbspLast&nbspName</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>City</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>State</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Country</b>&nbsp</center></th>');
		//echo('<th><center>&nbsp<b>Zip</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Email</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Phone</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>#Adult&nbspReg</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>#Child&nbspReg</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>#CHYK&nbspReg</b>&nbsp</center></th>');
		//echo('<th><center>&nbsp<b>#Tot&nbspReg</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Reg&nbspType</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Amt&nbspCmttd</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Amt&nbspPaid</b>&nbsp</center></th>');
		//echo('<th><center>&nbsp<b>Pay&nbspType</b>&nbsp</center></th>');
		//echo('<th><center>&nbsp<b>Check&nbspNum</b>&nbsp</center></th>');
		echo('<th><center>&nbsp<b>Pay&nbspStatus</b>&nbsp</center></th>');
		echo('</tr>');
		
		foreach( $mrhinfoarr as $mrhobj)
		{
			$mrv = Mahasamadhi_registration_value::cast( $mrhobj );

			if ($i % 2 != 0)
			{
				$rowColor = "#e0ffff";
			}
			else
			{
				$rowColor = "#ffffff";
			}

			echo('<tr bgcolor="'.$rowColor.'">');
			
			echo('<td><center>&nbsp<a href="'.base_url().'mahasamadhi/mahasamadhi_registration/ms_registrant_detail/'.$mrv->getRegCode().'/'.$urlKey.'" target="_self">'.$mrv->getRegCode().'</a>&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getFirstName().'&nbsp</center></td>');			
			echo('<td><center>&nbsp'.$mrv->getLastName().'&nbsp</center></td>');			
			echo('<td><center>&nbsp'.$mrv->getCHYKRefFirstName().'&nbsp</center></td>');			
			echo('<td><center>&nbsp'.$mrv->getCHYKRefLastName().'&nbsp</center></td>');			
			echo('<td><center>&nbsp'.$mrv->getCity().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getState().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getCountry().'&nbsp</center></td>');
			//echo('<td><center>&nbsp'.$mrv->getZip().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getEmail().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getPhone().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getNumAdultRegistered().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getNumChildRegistered().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getNumCHYKRegistered().'&nbsp</center></td>');
			//echo('<td><center>&nbsp'.$mrv->getTotalNumRegistered().'&nbsp</center></td>');
			echo('<td><center>&nbsp'.$mrv->getRegistrationTypeDescription().'&nbsp</center></td>');
			echo('<td><center>&nbsp$'.$mrv->getAmountCommitted().'&nbsp</center></td>');
			echo('<td><center>&nbsp$'.$mrv->getAmountPaid().'&nbsp</center></td>');
			//echo('<td><center>&nbsp'.$mrv->getPaymentType().'&nbsp</center></td><td>');
			//echo('<center>&nbsp'.$mrv->getCheckNum().'&nbsp</center></td>');

			switch (intval($mrv->getPaymentStatus()))
			{
				case 0:
					echo('<td><center>&nbspUnpaid&nbsp</center></td>');
					break;
				case 1:
					echo('<td><center>&nbspPaid&nbsp</center></td>');
					break;
				case 2:
					echo('<td><center>&nbspPending&nbsp</center></td>');
					break;
				case 3:
					echo('<td><center>&nbspRefund&nbsp</center></td>');
					break;
			}
			
			echo('</tr>');
						
			$i++;
		}

		echo('</table>');
	}
	else
		echo "No results returned";
?>
</div>
